package com.bifrost.entity;

import com.bifrost.constant.OrderItemType;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the PRODUCT_SKU database table.
 *
 * @author joewee
 */
@Entity
@Table(name = "PRODUCT_SKU",indexes = {
        @Index(name = "CATEGORY_ID_INDEX",columnList = "CATEGORY_ID",unique = false),
        @Index(name = "PRODUCT_ID_INDEX",columnList = "PRODUCT_ID",unique = false),
        @Index(name = "MERCHANT_ID_INDEX",columnList = "MERCHANT_ID",unique = false),
        @Index(name = "KEYWORD_INDEX",columnList = "KEYWORD",unique = false)
})
@NamedQuery(name = "ProductSku.findAll", query = "SELECT p FROM ProductSku p")
public class ProductSku extends BaseEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "SKU_ID", unique = true, nullable = false)
    private Long skuId;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "ACTIVE_END_DATE")
    private Date activeEndDate;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "ACTIVE_START_DATE")
    private Date activeStartDate;

    @Column(name = "CAN_ADD_CART")
    private Boolean canAddCart;

    @Column(name = "CONTAINER_SHAPE", length = 50)
    private String containerShape;

    @Column(name = "SPECIFICATION")
    private Integer specification;

    @Column(name = "SPECIFICATION_UNIT", length = 10)
    private String specificationUnit;

    @Column(name = "DIMENSION_UNIT", length = 10)
    private String dimensionUnit;

    @Column(name = "DISPLAY_TEMPLATE", length = 255)
    private String displayTemplate;

    @Column(name = "EXTERNAL_ID", length = 50)
    private String externalId;

    @Column(name = "FULFILLMENT_TYPE", length = 50)
    private String fulfillmentType;

    @Column(name = "INVENTORY_TYPE", length = 50)
    private String inventoryType;

    /*@Column(name = "IS_ARCHIVED")
    private Boolean archived;*/
    @Column(name = "MERCHANT_ID", nullable = false)
    private Long merchantId;


    @Column(name = "IS_AVAILABLE")
    private Boolean available = Boolean.TRUE;

    @Column(name = "IS_DEFAULT")
    private Boolean isDefault;

    @Column(name = "IS_DISCOUNTABLE")
    private Boolean discountable;

    @Lob
    @Column(name = "LONG_DESCRIPTION")
    private String longDescription;

    @Column(name = "RETAIL_PRICE", precision = 10, scale = 5)
    private BigDecimal retailPrice;

    @Column(name = "SALE_PRICE", precision = 10, scale = 5)
    private BigDecimal salePrice;

    @Column(name = "SKU_COST", precision = 10, scale = 5)
    private BigDecimal skuCost;

    @Column(name = "QUANTITY_AVAILABLE")
    protected Integer quantityAvailable = 0;

    @Column(name = "SKU_DESCRIPTION")
    private String skuDescription;

    @Column(name = "SKU_LENGTH", precision = 10, scale = 2)
    private BigDecimal skuLength;

    @Column(name = "SKU_HEIGHT", precision = 10, scale = 2)
    private BigDecimal skuHeight;

    @Column(name = "SKU_NAME", length = 255)
    private String skuName;

    @Column(name = "SKU_UPC", length = 50)
    private String skuUpc;

    @Column(name = "SKU_URL", length = 255)
    private String skuUrl;

    @Column(name = "SKU_WEIGHT", precision = 10, scale = 2)
    private BigDecimal skuWeight=BigDecimal.ZERO;

    @Column(name = "SKU_WIDTH", precision = 10, scale = 2)
    private BigDecimal skuWidth;
    @Column(name = "SKU_GIRTH", precision = 10, scale = 2)
    private BigDecimal skuGirth;

    @Column(name = "BONUS_POINTS_RATE", precision = 11)
    private Integer bonusPointsRate = 0;

    @Column(name = "CAN_PREORDER")
    private Boolean canPreorder = Boolean.FALSE;

    @Column(name = "PREORDER_DAYS", precision = 11)
    private Integer preorderDays = 0;

    @Column(name = "GUARANTEES_DAYS", precision = 11)
    private Integer guaranteesDays;

    @Column(name = "ITEM_TYPE", length = 64)
    private String itemType = OrderItemType.BASIC;

    @Column(name = "PRICING_MODEL", length = 64)
    private String pricingModel;

    @Column(name = "PROMOTABLE")
    private Boolean promotable;

    @Column(name = "WEIGHT_UNIT_OF_MEASURE", length = 10)
    private String weightUnitOfMeasure;

    @Column(name = "SALE_COUNT")
    private Long saleCount = 0L;

    @Column(name = "REVIEW_AVG")
    private Long reviewAVG = 0L;

    @Column(name = "PRODUCT_BRAND_ID")
    private Long productBrandId;

    @Column(name = "SKU_CODE")
    private String skuCode;

    @Column(name = "UNIT")
    private String unit;
    @Column(name = "MODEL")
    private String model;
    @Column(name = "ORIGIN_PLACE")
    private String originPlace;
    @Column(name = "GRADE")
    private String grade;

    @Column(name = "SORT_ORDER")
    private Integer sortOrder = 1;

    @Column(name = "MERCHANTABILITY")
    private Boolean merchantability=Boolean.FALSE;

    @Column(name = "KEYWORD",length = 128)
    private String keyword;

    @Column(name = "SORT_HOT")
    private Boolean sortHot=Boolean.FALSE;

    @Column(name = "IS_ENABLE_UPLOAD")
    private Boolean enableUpload=Boolean.FALSE;

    @OneToMany(mappedBy = "productSku")
    @org.hibernate.annotations.ForeignKey(name = "none")
    private List<CustomerWishlist> customerWishlists;

    @OneToMany(mappedBy = "productSku")
    @org.hibernate.annotations.ForeignKey(name = "none")
    private List<GiftwrapOrderItem> giftwrapOrderItems;

    @OneToMany(mappedBy = "productSku")
    @org.hibernate.annotations.ForeignKey(name = "none")
    private List<OrderBundleItem> orderBundleItems;

    @OneToMany(mappedBy = "productSku")
    @org.hibernate.annotations.ForeignKey(name = "none")
    private List<ProductReview> productReviews;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "PRODUCT_ID", foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
    private Product product;

    @OneToMany(mappedBy = "associationProductSku")
    @org.hibernate.annotations.ForeignKey(name = "none")
    private List<SkuAssociation> skuAssociations;

    @OneToMany(mappedBy = "productSku")
    @org.hibernate.annotations.ForeignKey(name = "none")
    private List<SkuAttribute> skuAttributes;

    @OneToMany(mappedBy = "productSku")
    @org.hibernate.annotations.ForeignKey(name = "none")
    private List<SkuBundleItem> skuBundleItems;

    //bi-directional many-to-one association to SkuFee
    @OneToMany(mappedBy = "productSku")
    @org.hibernate.annotations.ForeignKey(name = "none")
    private List<SkuFee> skuFees;

    //bi-directional many-to-one association to SkuMediaMap
    @OneToMany(mappedBy = "productSku")
    @org.hibernate.annotations.ForeignKey(name = "none")
    private List<SkuMediaMap> skuMediaMaps;

    //bi-directional many-to-one association to SkuOptionValue
    @OneToMany(mappedBy = "productSku")
    @org.hibernate.annotations.ForeignKey(name = "none")
    private List<SkuOptionValue> skuOptionValues;

    //bi-directional many-to-one association to SkuPriceHistory
    @OneToMany(mappedBy = "productSku")
    @org.hibernate.annotations.ForeignKey(name = "none")
    private List<SkuPriceHistory> skuPriceHistories;

    //bi-directional many-to-one association to SkuWarehouse
    @OneToMany(mappedBy = "productSku")
    @org.hibernate.annotations.ForeignKey(name = "none")
    private List<SkuWarehouse> skuWarehouses;

   /* @OneToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "DEFAULT_PRODUCT_ID", foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
    private Product defaultProduct;*/

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "CATEGORY_ID", foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
    private Category category;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "SHIPMENT_TEMPLATE", foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
    private SkuShipment shipmentTemplate;

    @OneToMany(mappedBy = "productSku", fetch = FetchType.LAZY)
    @org.hibernate.annotations.ForeignKey(name = "none")
    private List<PromotionSku> promotionSkus;

    @OneToMany(mappedBy = "productSku")
    @org.hibernate.annotations.ForeignKey(name = "none")
    private List<PlanItem> planItems;

    @OneToMany(mappedBy = "productSku")
    @org.hibernate.annotations.ForeignKey(name = "none")
    private List<PlanCusomer> planCusomers;

    public ProductSku() {
    }

    public Long getSkuId() {
        return this.skuId;
    }

    public void setSkuId(Long skuId) {
        this.skuId = skuId;
    }

    public Date getActiveEndDate() {
        return this.activeEndDate;
    }

    public void setActiveEndDate(Date activeEndDate) {
        this.activeEndDate = activeEndDate;
    }

    public Date getActiveStartDate() {
        return this.activeStartDate;
    }

    public void setActiveStartDate(Date activeStartDate) {
        this.activeStartDate = activeStartDate;
    }

    public Boolean getCanAddCart() {
        return this.canAddCart;
    }

    public void setCanAddCart(Boolean canAddCart) {
        this.canAddCart = canAddCart;
    }

    public String getContainerShape() {
        return this.containerShape;
    }

    public void setContainerShape(String containerShape) {
        this.containerShape = containerShape;
    }

    public String getSpecificationUnit() {
        return this.specificationUnit;
    }

    public void setSpecificationUnit(String specificationUnit) {
        this.specificationUnit = specificationUnit;
    }

    public Integer getSpecification() {
        return specification;
    }

    public void setSpecification(Integer specification) {
        this.specification = specification;
    }

    public String getDimensionUnit() {
        return this.dimensionUnit;
    }

    public void setDimensionUnit(String dimensionUnit) {
        this.dimensionUnit = dimensionUnit;
    }

    public String getDisplayTemplate() {
        return this.displayTemplate;
    }

    public void setDisplayTemplate(String displayTemplate) {
        this.displayTemplate = displayTemplate;
    }

    public String getExternalId() {
        return this.externalId;
    }

    public void setExternalId(String externalId) {
        this.externalId = externalId;
    }

    public String getFulfillmentType() {
        return this.fulfillmentType;
    }

    public void setFulfillmentType(String fulfillmentType) {
        this.fulfillmentType = fulfillmentType;
    }

    public String getInventoryType() {
        return this.inventoryType;
    }

    public void setInventoryType(String inventoryType) {
        this.inventoryType = inventoryType;
    }

    /*public Boolean isArchived() {
        return this.archived;
    }

    public void setArchived(Boolean isArchived) {
        this.archived = isArchived;
    }*/

    public Long getMerchantId() {
        return merchantId;
    }

    public void setMerchantId(Long merchantId) {
        this.merchantId = merchantId;
    }

    public Boolean isAvailable() {
        return this.available;
    }

    public void setAvailable(Boolean isAvailable) {
        this.available = isAvailable;
    }

    public Boolean isDefault() {
        return this.isDefault;
    }

    public void setDefault(Boolean isDefault) {
        this.isDefault = isDefault;
    }

    public Boolean isDiscountable() {
        return this.discountable;
    }

    public void setDiscountable(Boolean isDiscountable) {
        this.discountable = isDiscountable;
    }

    public String getLongDescription() {
        return this.longDescription;
    }

    public void setLongDescription(String longDescription) {
        this.longDescription = longDescription;
    }

    public BigDecimal getRetailPrice() {
        return this.retailPrice;
    }

    public void setRetailPrice(BigDecimal retailPrice) {
        this.retailPrice = retailPrice;
    }

    public BigDecimal getSalePrice() {
        return this.salePrice;
    }

    public void setSalePrice(BigDecimal salePrice) {
        this.salePrice = salePrice;
    }

    public BigDecimal getSkuCost() {
        return this.skuCost;
    }

    public void setSkuCost(BigDecimal skuCost) {
        this.skuCost = skuCost;
    }

    public Integer getQuantityAvailable() {
        return quantityAvailable;
    }

    public void setQuantityAvailable(Integer quantityAvailable) {
        this.quantityAvailable = quantityAvailable;
    }

    public String getSkuDescription() {
        return this.skuDescription;
    }

    public void setSkuDescription(String skuDescription) {
        this.skuDescription = skuDescription;
    }

    public BigDecimal getSkuLength() {
        return this.skuLength;
    }

    public void setSkuLength(BigDecimal skuLength) {
        this.skuLength = skuLength;
    }

    public BigDecimal getSkuHeight() {
        return this.skuHeight;
    }

    public void setSkuHeight(BigDecimal skuHeight) {
        this.skuHeight = skuHeight;
    }

    public String getSkuName() {
        return this.skuName;
    }

    public void setSkuName(String skuName) {
        this.skuName = skuName;
    }

    public String getSkuUpc() {
        return this.skuUpc;
    }

    public void setSkuUpc(String skuUpc) {
        this.skuUpc = skuUpc;
    }

    public String getSkuUrl() {
        return this.skuUrl;
    }

    public void setSkuUrl(String skuUrl) {
        this.skuUrl = skuUrl;
    }

    public BigDecimal getSkuWeight() {
        return this.skuWeight;
    }

    public void setSkuWeight(BigDecimal skuWeight) {
        this.skuWeight = skuWeight;
    }

    public BigDecimal getSkuWidth() {
        return this.skuWidth;
    }

    public void setSkuWidth(BigDecimal skuWidth) {
        this.skuWidth = skuWidth;
    }

    public BigDecimal getSkuGirth() {
        return skuGirth;
    }

    public void setSkuGirth(BigDecimal skuGirth) {
        this.skuGirth = skuGirth;
    }

    public String getItemType() {
        return itemType;
    }

    public void setItemType(String itemType) {
        this.itemType = itemType;
    }

    public String getPricingModel() {
        return pricingModel;
    }

    public void setPricingModel(String pricingModel) {
        this.pricingModel = pricingModel;
    }

    public Boolean getPromotable() {
        return promotable;
    }

    public void setPromotable(Boolean promotable) {
        this.promotable = promotable;
    }

    public Integer getSortOrder() {
        return sortOrder;
    }

    public void setSortOrder(Integer sortOrder) {
        this.sortOrder = sortOrder;
    }

    public String getWeightUnitOfMeasure() {
        return this.weightUnitOfMeasure;
    }

    public void setWeightUnitOfMeasure(String weightUnitOfMeasure) {
        this.weightUnitOfMeasure = weightUnitOfMeasure;
    }

    public Integer getBonusPointsRate() {
        return bonusPointsRate;
    }

    public void setBonusPointsRate(Integer bonusPointsRate) {
        this.bonusPointsRate = bonusPointsRate;
    }

    public Boolean getCanPreorder() {
        return canPreorder;
    }

    public void setCanPreorder(Boolean canPreorder) {
        this.canPreorder = canPreorder;
    }

    public Integer getPreorderDays() {
        return preorderDays;
    }

    public void setPreorderDays(Integer preorderDays) {
        this.preorderDays = preorderDays;
    }

    public Integer getGuaranteesDays() {
        return guaranteesDays;
    }

    public void setGuaranteesDays(Integer guaranteesDays) {
        this.guaranteesDays = guaranteesDays;
    }

    public List<CustomerWishlist> getCustomerWishlists() {
        return this.customerWishlists;
    }

    public void setCustomerWishlists(List<CustomerWishlist> customerWishlists) {
        this.customerWishlists = customerWishlists;
    }

    public CustomerWishlist addCustomerWishlist(CustomerWishlist customerWishlist) {
        getCustomerWishlists().add(customerWishlist);
        customerWishlist.setProductSku(this);

        return customerWishlist;
    }

    public CustomerWishlist removeCustomerWishlist(CustomerWishlist customerWishlist) {
        getCustomerWishlists().remove(customerWishlist);
        customerWishlist.setProductSku(null);

        return customerWishlist;
    }

    public List<GiftwrapOrderItem> getGiftwrapOrderItems() {
        return this.giftwrapOrderItems;
    }

    public void setGiftwrapOrderItems(List<GiftwrapOrderItem> giftwrapOrderItems) {
        this.giftwrapOrderItems = giftwrapOrderItems;
    }

    public GiftwrapOrderItem addGiftwrapOrderItem(GiftwrapOrderItem giftwrapOrderItem) {
        getGiftwrapOrderItems().add(giftwrapOrderItem);
        giftwrapOrderItem.setProductSku(this);

        return giftwrapOrderItem;
    }

    public GiftwrapOrderItem removeGiftwrapOrderItem(GiftwrapOrderItem giftwrapOrderItem) {
        getGiftwrapOrderItems().remove(giftwrapOrderItem);
        giftwrapOrderItem.setProductSku(null);

        return giftwrapOrderItem;
    }

    public List<OrderBundleItem> getOrderBundleItems() {
        return this.orderBundleItems;
    }

    public void setOrderBundleItems(List<OrderBundleItem> orderBundleItems) {
        this.orderBundleItems = orderBundleItems;
    }

    public OrderBundleItem addOrderBundleItem(OrderBundleItem orderBundleItem) {
        getOrderBundleItems().add(orderBundleItem);
        orderBundleItem.setProductSku(this);

        return orderBundleItem;
    }

    public OrderBundleItem removeOrderBundleItem(OrderBundleItem orderBundleItem) {
        getOrderBundleItems().remove(orderBundleItem);
        orderBundleItem.setProductSku(null);

        return orderBundleItem;
    }

    public List<ProductReview> getProductReviews() {
        return this.productReviews;
    }

    public void setProductReviews(List<ProductReview> productReviews) {
        this.productReviews = productReviews;
    }

    public ProductReview addProductReview(ProductReview productReview) {
        getProductReviews().add(productReview);
        productReview.setProductSku(this);

        return productReview;
    }

    public ProductReview removeProductReview(ProductReview productReview) {
        getProductReviews().remove(productReview);
        productReview.setProductSku(null);

        return productReview;
    }

    public Product getProduct() {
        return this.product;
    }

    public void setProduct(Product product) {
        this.product = product;
    }


    public List<SkuAssociation> getSkuAssociations() {
        return this.skuAssociations;
    }

    public void setSkuAssociations(List<SkuAssociation> skuAssociations) {
        this.skuAssociations = skuAssociations;
    }

    public SkuAssociation addSkuAssociations(SkuAssociation associationProductSkus) {
        getSkuAssociations().add(associationProductSkus);
        associationProductSkus.setAssociationProductSku(this);

        return associationProductSkus;
    }

    public SkuAssociation removeSkuAssociations(SkuAssociation associationProductSkus) {
        getSkuAssociations().remove(associationProductSkus);
        associationProductSkus.setAssociationProductSku(null);

        return associationProductSkus;
    }

    public List<SkuAttribute> getSkuAttributes() {
        return this.skuAttributes;
    }

    public void setSkuAttributes(List<SkuAttribute> skuAttributes) {
        this.skuAttributes = skuAttributes;
    }

    public SkuAttribute addSkuAttribute(SkuAttribute skuAttribute) {
        getSkuAttributes().add(skuAttribute);
        skuAttribute.setProductSku(this);

        return skuAttribute;
    }

    public SkuAttribute removeSkuAttribute(SkuAttribute skuAttribute) {
        getSkuAttributes().remove(skuAttribute);
        skuAttribute.setProductSku(null);

        return skuAttribute;
    }

    public List<SkuBundleItem> getSkuBundleItems() {
        return this.skuBundleItems;
    }

    public void setSkuBundleItems(List<SkuBundleItem> skuBundleItems) {
        this.skuBundleItems = skuBundleItems;
    }

    public SkuBundleItem addSkuBundleItem(SkuBundleItem skuBundleItem) {
        getSkuBundleItems().add(skuBundleItem);
        skuBundleItem.setProductSku(this);

        return skuBundleItem;
    }

    public SkuBundleItem removeSkuBundleItem(SkuBundleItem skuBundleItem) {
        getSkuBundleItems().remove(skuBundleItem);
        skuBundleItem.setProductSku(null);

        return skuBundleItem;
    }

    public List<SkuFee> getSkuFees() {
        return this.skuFees;
    }

    public void setSkuFees(List<SkuFee> skuFees) {
        this.skuFees = skuFees;
    }

    public SkuFee addSkuFee(SkuFee skuFee) {
        getSkuFees().add(skuFee);
        skuFee.setProductSku(this);

        return skuFee;
    }

    public SkuFee removeSkuFee(SkuFee skuFee) {
        getSkuFees().remove(skuFee);
        skuFee.setProductSku(null);

        return skuFee;
    }

    public List<SkuMediaMap> getSkuMediaMaps() {
        return this.skuMediaMaps;
    }

    public void setSkuMediaMaps(List<SkuMediaMap> skuMediaMaps) {
        this.skuMediaMaps = skuMediaMaps;
    }

    public SkuMediaMap addSkuMediaMap(SkuMediaMap skuMediaMap) {
        getSkuMediaMaps().add(skuMediaMap);
        skuMediaMap.setProductSku(this);

        return skuMediaMap;
    }

    public SkuMediaMap removeSkuMediaMap(SkuMediaMap skuMediaMap) {
        getSkuMediaMaps().remove(skuMediaMap);
        skuMediaMap.setProductSku(null);

        return skuMediaMap;
    }

    public List<SkuOptionValue> getSkuOptionValues() {
        return this.skuOptionValues;
    }

    public void setSkuOptionValues(List<SkuOptionValue> skuOptionValues) {
        this.skuOptionValues = skuOptionValues;
    }

    public SkuOptionValue addSkuOptionValue(SkuOptionValue skuOptionValue) {
        getSkuOptionValues().add(skuOptionValue);
        skuOptionValue.setProductSku(this);

        return skuOptionValue;
    }

    public SkuOptionValue removeSkuOptionValue(SkuOptionValue skuOptionValue) {
        getSkuOptionValues().remove(skuOptionValue);
        skuOptionValue.setProductSku(null);

        return skuOptionValue;
    }

    public List<SkuPriceHistory> getSkuPriceHistories() {
        return this.skuPriceHistories;
    }

    public void setSkuPriceHistories(List<SkuPriceHistory> skuPriceHistories) {
        this.skuPriceHistories = skuPriceHistories;
    }

    public SkuPriceHistory addSkuPriceHistory(SkuPriceHistory skuPriceHistory) {
        getSkuPriceHistories().add(skuPriceHistory);
        skuPriceHistory.setProductSku(this);

        return skuPriceHistory;
    }

    public SkuPriceHistory removeSkuPriceHistory(SkuPriceHistory skuPriceHistory) {
        getSkuPriceHistories().remove(skuPriceHistory);
        skuPriceHistory.setProductSku(null);

        return skuPriceHistory;
    }

    public List<SkuWarehouse> getSkuWarehouses() {
        return this.skuWarehouses;
    }

    public void setSkuWarehouses(List<SkuWarehouse> skuWarehouses) {
        this.skuWarehouses = skuWarehouses;
    }

    public SkuWarehouse addSkuWarehous(SkuWarehouse skuWarehous) {
        getSkuWarehouses().add(skuWarehous);
        skuWarehous.setProductSku(this);

        return skuWarehous;
    }

    public SkuWarehouse removeSkuWarehous(SkuWarehouse skuWarehous) {
        getSkuWarehouses().remove(skuWarehous);
        skuWarehous.setProductSku(null);

        return skuWarehous;
    }

    /*public Product getDefaultProduct() {
        return defaultProduct;
    }

    public void setDefaultProduct(Product defaultProduct) {
        this.defaultProduct = defaultProduct;
    }*/

    public Category getCategory() {
        return category;
    }

    public void setCategory(Category category) {
        this.category = category;
    }

    public Long getSaleCount() {
        return saleCount;
    }

    public void setSaleCount(Long saleCount) {
        this.saleCount = saleCount;
    }

    public Long getReviewAVG() {
        return reviewAVG;
    }

    public void setReviewAVG(Long reviewAVG) {
        this.reviewAVG = reviewAVG;
    }

    public Long getProductBrandId() {
        return productBrandId;
    }

    public void setProductBrandId(Long productBrandId) {
        this.productBrandId = productBrandId;
    }

    public String getSkuCode() {
        return skuCode;
    }

    public void setSkuCode(String skuCode) {
        this.skuCode = skuCode;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public String getModel() {
        return model;
    }

    public void setModel(String model) {
        this.model = model;
    }

    public String getOriginPlace() {
        return originPlace;
    }

    public void setOriginPlace(String originPlace) {
        this.originPlace = originPlace;
    }

    public String getGrade() {
        return grade;
    }

    public void setGrade(String grade) {
        this.grade = grade;
    }

    public SkuShipment getShipmentTemplate() {
        return shipmentTemplate;
    }

    public void setShipmentTemplate(SkuShipment shipmentTemplate) {
        this.shipmentTemplate = shipmentTemplate;
    }
    public boolean isActive(){
        //return DateUtils.isActive(this.getActiveStartDate(),this.getActiveEndDate());
        //目前返回true。 sku不做生效日期判断
        return true;
    }

    public Boolean getMerchantability() {
        return merchantability;
    }

    public void setMerchantability(Boolean merchantability) {
        this.merchantability = merchantability;
    }

    public List<PromotionSku> getPromotionSkus() {
        return promotionSkus;
    }

    public void setPromotionSkus(List<PromotionSku> promotionSkus) {
        this.promotionSkus = promotionSkus;
    }

    public Boolean getAvailable() {
        return available;
    }

    public String getKeyword() {
        return keyword;
    }

    public void setKeyword(String keyword) {
        this.keyword = keyword;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ProductSku sku = (ProductSku) o;

        if (!getSkuId().equals(sku.getSkuId())) return false;
        if (!getExternalId().equals(sku.getExternalId())) return false;
        if (getFulfillmentType() != null ? !getFulfillmentType().equals(sku.getFulfillmentType()) : sku.getFulfillmentType() != null)
            return false;
        if (getInventoryType() != null ? !getInventoryType().equals(sku.getInventoryType()) : sku.getInventoryType() != null)
            return false;
        if (getMerchantId() != null ? !getMerchantId().equals(sku.getMerchantId()) : sku.getMerchantId() != null)
            return false;
        if (!available.equals(sku.available)) return false;
        if (!getSkuName().equals(sku.getSkuName())) return false;
        if (!getItemType().equals(sku.getItemType())) return false;
        return getSkuCode() != null ? getSkuCode().equals(sku.getSkuCode()) : sku.getSkuCode() == null;
    }

    @Override
    public int hashCode() {
        int result = getSkuId().hashCode();
        result = 31 * result + (getExternalId() != null ? getExternalId().hashCode():0);
        result = 31 * result + (getFulfillmentType() != null ? getFulfillmentType().hashCode() : 0);
        result = 31 * result + (getInventoryType() != null ? getInventoryType().hashCode() : 0);
        result = 31 * result + (getMerchantId() != null ? getMerchantId().hashCode() : 0);
        result = 31 * result + available.hashCode();
        result = 31 * result + getSkuName().hashCode();
        result = 31 * result + getItemType().hashCode();
        result = 31 * result + (getSkuCode() != null ? getSkuCode().hashCode() : 0);
        return result;
    }

    public Boolean getSortHot() {
        return sortHot;
    }

    public void setSortHot(Boolean sortHot) {
        this.sortHot = sortHot;
    }

    public Boolean getEnableUpload() {
        return enableUpload;
    }

    public void setEnableUpload(Boolean enableUpload) {
        this.enableUpload = enableUpload;
    }

}